<template>
  <div class="custom-body" :style="borderStyle">
    <!--  模版头  -->
    <default-column-header v-if="showHeader" :temp="temp" />
    <!-- 内容部分  -->
    <div class="custom-content" :style="contentStyle">
      <el-empty
        v-if="dataList === null || dataList.length === 0"
        :image-size="100"
      />
      <div v-else>
        <div
          v-for="(obj, index) in dataList"
          :key="'obj-' + index"
          class="custom-ul-li"
          :style="lineStyle"
          @click="openEntity(obj)"
        >
          <div class="custom-li-line">
            {{ obj[column[0].title] }}
          </div>

          <div v-if="obj[column[0].left]" class="li-line">
            {{ obj[column[0].left] }}
          </div>
          <div v-if="obj[column[0].right]" class="li-line">
            {{ obj[column[0].right] }}
          </div>
          <div v-if="obj[column[0].time]" class="li-line">
            {{ obj[column[0].time] }}
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { template } from '@/mixins/template'
import DefaultColumnHeader from '@/portal4.1/pc/component/column/DefaultColumnHeader.vue'
import { layout } from '@/mixins/layout'
export default {
  name: 'PcNewListTempV2',
  components: { DefaultColumnHeader },
  mixins: [template, layout],
  computed: {
    themes() {
      return this.$store.getters.theme
    },
    lineStyle() {
      return { '--font-color': this.layoutTheme.menuColor, '--font-active-color': this.layoutTheme.menuActiveColor, '--back-color': this.layoutTheme.menuActiveBackground }
    }
  }
}
</script>

<style lang="scss" scoped>
.custom-body {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-flow: column nowrap;
  padding: 0px 0px 10px 0px;
  box-sizing: border-box;
  overflow: hidden;
}
.custom-header {
  width: 100%;
  height: 40px;
  flex: 0 1 auto;
  padding: 0 10px;
  box-sizing: border-box;
  line-height: 40px;
  cursor: pointer;
}
.custom-content {
  width: 100%;
  height: auto;
  flex: 1 1 auto;
  padding: 0 20px;
  overflow: hidden;
  box-sizing: border-box;
}
.custom-ul-li {
  position: relative;
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  padding: 2px 15px;
  justify-content: space-between;
  flex-flow: row wrap;
  box-sizing: border-box;
  cursor: pointer;
  color: var(--font-color);
}
.custom-ul-li:hover {
  color: var(--font-active-color);
  background-color: var(--back-color);
}
.custom-ul-li:before {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background-color: #a8abb2;;
  left: 8px;
  top: 10px;
}
.custom-li-line {
  width: 100%;
  height: 25px;
  line-height: 25px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}
.li-line {
  height: 21px;
  line-height: 21px;
  font-size: 0.9rem;
  color: #a8abb2;
}
.custom-ul-li:not(:last-child) {
  border-bottom: 1px solid #f6f6f6;
}
</style>
